USE [test_new]
GO

ALTER TABLE [dbo].[task_Tasks] DROP CONSTRAINT [FK_task_Main_Tasks_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Tasks] DROP CONSTRAINT [FK_task_Main_Tasks_task_LDAP_Logins1]
GO
ALTER TABLE [dbo].[task_Tasks] DROP CONSTRAINT [FK_task_Main_Tasks_task_LDAP_Logins2]
GO
ALTER TABLE [dbo].[task_Tasks] DROP CONSTRAINT [FK_task_Main_Tasks_task_LDAP_Logins3]
GO
ALTER TABLE [dbo].[task_Reminders] DROP CONSTRAINT [FK_task_Reminder_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Readers] DROP CONSTRAINT [FK_task_Other_Readed_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Participants] DROP CONSTRAINT [FK_task_Main_Participants_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Participants] DROP CONSTRAINT [FK_task_Main_Participants_task_LDAP_Logins1]
GO
ALTER TABLE [dbo].[task_Comments] DROP CONSTRAINT [FK_task_Main_Comments_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_AccountsManagers] DROP CONSTRAINT [FK_AccountRef_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_AccountsManagers] DROP CONSTRAINT [FK_AccountRef_task_LDAP_Logins1]
GO
ALTER TABLE [dbo].[task_DepartmentUser] DROP CONSTRAINT [FK_task_DepartmentUser_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Files] DROP CONSTRAINT [FK_task_Main_Files_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_Accounts] DROP CONSTRAINT [PK_task_LDAP_Logins]
GO
ALTER TABLE [dbo].[task_AccountsManagers] DROP CONSTRAINT [PK_AccountRef]
GO

ALTER TABLE [dbo].[task_Reminders] DROP CONSTRAINT [FK_task_Reminder_task_Main_Tasks]
GO
ALTER TABLE [dbo].[task_Ratings] DROP CONSTRAINT [FK_task_Ratings_task_Tasks]
GO
ALTER TABLE [dbo].[task_WorkingPeriods] DROP CONSTRAINT [FK_task_WorkingPeriods_task_Tasks]
GO
ALTER TABLE [dbo].[task_Files] DROP CONSTRAINT [FK_task_Main_Files_task_Main_Tasks]
GO
ALTER TABLE [dbo].[task_Comments] DROP CONSTRAINT [FK_task_Main_Comments_task_Main_Tasks]
GO
ALTER TABLE [dbo].[task_Participants] DROP CONSTRAINT [FK_task_Main_Participants_task_Main_Tasks]
GO
ALTER TABLE [dbo].[task_Readers] DROP CONSTRAINT [FK_task_Other_Readed_task_Main_Tasks]
GO
ALTER TABLE [dbo].[task_Tasks] DROP CONSTRAINT [PK_task_Main_Tasks]
GO

ALTER TABLE [dbo].[task_Comments] DROP CONSTRAINT [PK_task_Main_Comments]
GO

ALTER TABLE [dbo].[task_DepartmentUser] DROP CONSTRAINT [FK_task_DepartmentUser_task_Main_DepPath]
GO
ALTER TABLE [dbo].[task_Departments] DROP CONSTRAINT [PK_task_Main_DepPath]
GO

ALTER TABLE [dbo].[task_DepartmentUser] DROP CONSTRAINT [FK_task_DepartmentUser_task_Rules_Groups]
GO
ALTER TABLE [dbo].[task_DepartmentUser] DROP CONSTRAINT [PK_task_DepartmentUser]
GO

ALTER TABLE [dbo].[task_Files] DROP CONSTRAINT [PK_task_Main_Files]
GO
ALTER TABLE [dbo].[task_Participants] DROP CONSTRAINT [PK_task_Main_Participants]
GO
ALTER TABLE [dbo].[task_Priorities] DROP CONSTRAINT [PK_task_Names_Priority]
GO
ALTER TABLE [dbo].[task_Ratings] DROP CONSTRAINT [PK_task_Ratings]
GO
ALTER TABLE [dbo].[task_Reminders] DROP CONSTRAINT [PK_task_Reminder]
GO
ALTER TABLE [dbo].[task_Roles] DROP CONSTRAINT [PK_task_Rules_Groups]
GO
ALTER TABLE [dbo].[task_Status] DROP CONSTRAINT [PK_task_Names_Status]
GO
ALTER TABLE [dbo].[task_WorkingPeriods] DROP CONSTRAINT [PK_task_WorkingPeriods]
GO

DROP INDEX [IX_AccountID] ON [dbo].[task_Readers] WITH ( ONLINE = OFF )
GO
DROP INDEX [IX_FileID] ON [dbo].[task_Comments]
DROP INDEX [IX_TaskID] ON [dbo].[task_Comments]
GO
DROP INDEX [IX_TaskID] ON [dbo].[task_Files]
GO

DROP INDEX [IX_task_Readers] ON [dbo].[task_Readers]
DROP INDEX [IX_task_Readers_1] ON [dbo].[task_Readers]
DROP INDEX [IX_ID] ON [dbo].[task_Readers]
DROP INDEX [IX_TaskID] ON [dbo].[task_Readers]
GO

DROP INDEX [IX_ExecutorID] ON [dbo].[task_Tasks]
DROP INDEX [IX_OwnerID] ON [dbo].[task_Tasks]
DROP INDEX [IX_Department] ON [dbo].[task_Tasks]
GO


